import Common from './common'
export default {
  user_update (user) {
    return Common.request({ url: Common.getApiUrl(Common.ELE_MONKEY_SERVER_URL.MERCHANT, Common.ELE_MONKEY_API.MERCHANT.USER_UPDATE), method: 'post', data: user })
  },
  user_login (user) {
    return Common.request({ url: Common.getApiUrl(Common.ELE_MONKEY_SERVER_URL.MERCHANT, Common.ELE_MONKEY_API.MERCHANT.USER_LOGIN), method: 'post', data: user })
  },
  user_msg (userId) {
    return Common.request({ url: Common.getApiUrl(Common.ELE_MONKEY_SERVER_URL.MERCHANT, Common.ELE_MONKEY_API.MERCHANT.USER_MSG + '/' + userId), method: 'get', data: {} })
  },
  user_register (user) {
    return Common.request({ url: Common.getApiUrl(Common.ELE_MONKEY_SERVER_URL.MERCHANT, Common.ELE_MONKEY_API.MERCHANT.USER_REGISTER), method: 'post', data: user })
  },
  order_allCount (storeId) {
    return Common.request({ url: Common.getApiUrl(Common.ELE_MONKEY_SERVER_URL.MERCHANT, Common.ELE_MONKEY_API.MERCHANT.ORDER_ALLCOUNT + '/' + storeId), method: 'get', data: {} })
  },
  order_activeCount (storeId) {
    return Common.request({ url: Common.getApiUrl(Common.ELE_MONKEY_SERVER_URL.MERCHANT, Common.ELE_MONKEY_API.MERCHANT.ORDER_ACTIVECOUNT + '/' + storeId), method: 'get', data: {} })
  },
  order_newCount (storeId) {
    return Common.request({ url: Common.getApiUrl(Common.ELE_MONKEY_SERVER_URL.MERCHANT, Common.ELE_MONKEY_API.MERCHANT.ORDER_NEWCOUNT + '/' + storeId), method: 'get', data: {} })
  },
  order_all (storeId, page, pageSize) {
    return Common.request({ url: Common.getApiUrl(Common.ELE_MONKEY_SERVER_URL.MERCHANT, Common.ELE_MONKEY_API.MERCHANT.ORDER_ALL + '/' + storeId + '?page=' + page + '&pageSize=' + pageSize), method: 'get', data: {} })
  },
  merchant_apply (store, params) {
    return Common.request({ url: Common.getApiUrl(Common.ELE_MONKEY_SERVER_URL.MERCHANT, Common.ELE_MONKEY_API.MERCHANT.MERCHANT_APPLY), method: 'post', data: store })
  },
  store_products (storeId, page, pageSize) {
    return Common.request({ url: Common.getApiUrl(Common.ELE_MONKEY_SERVER_URL.MERCHANT, Common.ELE_MONKEY_API.MERCHANT.STORE_PRODUCTS + '/' + storeId + '?page=' + page + '&pageSize=' + pageSize), method: 'get', data: {} })
  },
  order_add (order) {
    return Common.request({ url: Common.getApiUrl(Common.ELE_MONKEY_SERVER_URL.MERCHANT, Common.ELE_MONKEY_API.MERCHANT.ORDER_ADD), method: 'post', data: order })
  },
  store_msg (storeId) {
    return Common.request({ url: Common.getApiUrl(Common.ELE_MONKEY_SERVER_URL.MERCHANT, Common.ELE_MONKEY_API.MERCHANT.STORE_MSG + '/' + storeId), method: 'get', data: {} })
  },
  store_updateStatus (orderId, status) {
    return Common.request({ url: Common.getApiUrl(Common.ELE_MONKEY_SERVER_URL.MERCHANT, Common.ELE_MONKEY_API.MERCHANT.STORE_UPDATESTATUS), method: 'post', data: {id: orderId, status: status} })
  },
  product_add (product) {
    return Common.request({ url: Common.getApiUrl(Common.ELE_MONKEY_SERVER_URL.MERCHANT, Common.ELE_MONKEY_API.MERCHANT.PRODUCT_ADD), method: 'post', data: product })
  },
  product_update (product) {
    return Common.request({ url: Common.getApiUrl(Common.ELE_MONKEY_SERVER_URL.MERCHANT, Common.ELE_MONKEY_API.MERCHANT.PRODUCT_UPDATE), method: 'post', data: product })
  },
  product_delete (productId) {
    return Common.request({ url: Common.getApiUrl(Common.ELE_MONKEY_SERVER_URL.MERCHANT, Common.ELE_MONKEY_API.MERCHANT.PRODUCT_DELETE + '/' + productId), method: 'get', data: {} })
  },
  store_comments (storeId) {
    return Common.request({ url: Common.getApiUrl(Common.ELE_MONKEY_SERVER_URL.MERCHANT, Common.ELE_MONKEY_API.MERCHANT.STORE_COMMENTS + '/' + storeId), method: 'get', data: {} })
  },
  order_comment (orderId) {
    return Common.request({ url: Common.getApiUrl(Common.ELE_MONKEY_SERVER_URL.MERCHANT, Common.ELE_MONKEY_API.MERCHANT.ORDER_COMMENT + '/' + orderId), method: 'get', data: {} })
  },
  comment_add (comment) {
    return Common.request({ url: Common.getApiUrl(Common.ELE_MONKEY_SERVER_URL.MERCHANT, Common.ELE_MONKEY_API.MERCHANT.ORDER_COMMENT), method: 'post', data: comment })
  },
  store_update (store) {
    return Common.request({ url: Common.getApiUrl(Common.ELE_MONKEY_SERVER_URL.MERCHANT, Common.ELE_MONKEY_API.MERCHANT.STORE_UPDATE), method: 'post', data: store })
  },
  ad_push (ad) {
    return Common.request({ url: Common.getApiUrl(Common.ELE_MONKEY_SERVER_URL.MERCHANT, Common.ELE_MONKEY_API.MERCHANT.AD_SEND), method: 'post', data: ad })
  },
  store_byUserId (userId) {
    return Common.request({ url: Common.getApiUrl(Common.ELE_MONKEY_SERVER_URL.MERCHANT, Common.ELE_MONKEY_API.MERCHANT.STORE_BYUSERID + '/' + userId), method: 'get', data: {} })
  }
}
